//
//  ZZXLocationHeaderCollectionReusableView.m
//  Travel
//
//  Created by dllo on 15/12/1.
//  Copyright © 2015年 doll. All rights reserved.
//

#import "ZZXLocationHeaderCollectionReusableView.h"

@interface ZZXLocationHeaderCollectionReusableView ()
@property (nonatomic, strong)UILabel *blueLable;
@property (nonatomic, strong)UILabel *titleLable;



@end

@implementation ZZXLocationHeaderCollectionReusableView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView
{
    
    
    self.blueLable = [[UILabel alloc]init];
    self.blueLable.backgroundColor = [UIColor colorWithRed:0.26 green:0.55 blue:0.58 alpha:1];
    [self  addSubview:self.blueLable];
  
    
    self.titleLable = [[UILabel alloc]init];
    self.titleLable.textColor = [UIColor darkGrayColor];
    self.titleLable.font = [UIFont fontWithName:@"Arial-Bold" size:15];
    self.titleLable.text =  @"精彩攻略";
    
    [self addSubview:self.titleLable];
   
    
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    [super applyLayoutAttributes:layoutAttributes];
//    //夜间模式
//    if ([[NSUserDefaults standardUserDefaults]boolForKey:@"isNight"]) {
//        self.backgroundColor = [UIColor colorWithRed:0.28 green:0.28 blue:0.28 alpha:1];
//        
//        self.titleLable.textColor = [UIColor whiteColor];
//    }else
    {
        self.backgroundColor = [UIColor colorWithRed:0.98 green:0.97 blue:0.93 alpha:1];
    }
    self.blueLable.frame = CGRectMake(10, 20 , 5, 24);
    self.titleLable.frame = CGRectMake(25, _blueLable.frame.origin.y, self.frame.size.width - 25 - 200, _blueLable.frame.size.height);
}





@end
